<?php
/**
 * User: @lixu
 * Date: 2019-08-12
 * Time: 14:40
 */

use Infinity\service\designerVote\DivisionList as sDivisionList;
/**
 * @deprecated
 */
class DivisionListAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $divisionType = $this->getRequest()->getPost('division_type');
        $houseType = $this->getRequest()->getPost('house_type');

        if(!in_array($divisionType, [1, 2, 3, 4, 5])) {
            throw new \Exception('赛区类型错误');
        }

        if(!in_array($houseType, [1, 2, 3])) {
            throw new \Exception('赛区户型错误');
        }

        $divisionList['list'] = sDivisionList::getDivisionList($divisionType, $houseType);
        $this->setSuccess($divisionList);
    }
}